/**
 * This is a generated class and is not intended for modification.  To customize behavior
 * of this value object you may modify the generated sub-class of this class - VoAmendHeader.as.
 */

package com.model.valueObjects
{
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.util.FiberUtils;
import com.adobe.fiber.valueobjects.IValueObject;
import flash.events.Event;
import flash.events.EventDispatcher;
import mx.binding.utils.ChangeWatcher;
import mx.collections.ArrayCollection;
import mx.events.CollectionEvent;
import mx.events.PropertyChangeEvent;
import mx.validators.ValidationResult;

import flash.net.registerClassAlias;
import flash.net.getClassByAlias;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

use namespace model_internal;

[ExcludeClass]
public class _Super_VoAmendHeader extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
{
    model_internal static function initRemoteClassAliasSingle(cz:Class) : void
    {
        try
        {
            if (flash.net.getClassByAlias("VoAmendHeader") == null)
            {
                flash.net.registerClassAlias("VoAmendHeader", cz);
            }
        }
        catch (e:Error)
        {
            flash.net.registerClassAlias("VoAmendHeader", cz);
        }
    }

    model_internal static function initRemoteClassAliasAllRelated() : void
    {
    }

    model_internal var _dminternal_model : _VoAmendHeaderEntityMetadata;

    /**
     * properties
     */
    private var _internal_total_qty : int;
    private var _internal_po_closed_date : String;
    private var _internal_pro_tax : ArrayCollection;
    private var _internal_cre_userid_fk : int;
    private var _internal_po_remarks : String;
    private var _internal_po_amend_serialnumber : int;
    private var _internal_unit_price : ArrayCollection;
    private var _internal_po_amend_detserialnumber : ArrayCollection;
    private var _internal_po_issue_date : String;
    private var _internal_pro_qty : ArrayCollection;
    private var _internal_activestatus : Boolean;
    private var _internal_total_amt : Number;
    private var _internal_enq_serialnumber_fk : ArrayCollection;
    private var _internal_po_serialnumber_fk : int;
    private var _internal_po_amend_serialnumber_fk : ArrayCollection;
    private var _internal_cre_datetime : String;
    private var _internal_po_status : String;
    private var _internal_pro_total_price : ArrayCollection;
    private var _internal_supplier_serialnumber_fk : int;
    private var _internal_pro_serialnumber_fk : ArrayCollection;
    private var _internal_discount : Number;
    private var _internal_expected_datetime : String;
    private var _internal_pro_discount : ArrayCollection;
    private var _internal_tax : Number;
    private var _internal_po_amend_id : String;
    private var _internal_shipment_charge : Number;
    private var _internal_enq_amend_po_serialnumber : ArrayCollection;

    private static var emptyArray:Array = new Array();

    // Change this value according to your application's floating-point precision
    private static var epsilon:Number = 0.0001;

    /**
     * derived property cache initialization
     */
    model_internal var _cacheInitialized_isValid:Boolean = false;

    model_internal var _changeWatcherArray:Array = new Array();

    public function _Super_VoAmendHeader()
    {
        _model = new _VoAmendHeaderEntityMetadata(this);

        // Bind to own data properties for cache invalidation triggering
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "po_closed_date", model_internal::setterListenerPo_closed_date));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "pro_tax", model_internal::setterListenerPro_tax));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "po_remarks", model_internal::setterListenerPo_remarks));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "unit_price", model_internal::setterListenerUnit_price));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "po_amend_detserialnumber", model_internal::setterListenerPo_amend_detserialnumber));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "po_issue_date", model_internal::setterListenerPo_issue_date));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "pro_qty", model_internal::setterListenerPro_qty));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "enq_serialnumber_fk", model_internal::setterListenerEnq_serialnumber_fk));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "po_amend_serialnumber_fk", model_internal::setterListenerPo_amend_serialnumber_fk));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "cre_datetime", model_internal::setterListenerCre_datetime));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "po_status", model_internal::setterListenerPo_status));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "pro_total_price", model_internal::setterListenerPro_total_price));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "pro_serialnumber_fk", model_internal::setterListenerPro_serialnumber_fk));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "expected_datetime", model_internal::setterListenerExpected_datetime));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "pro_discount", model_internal::setterListenerPro_discount));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "po_amend_id", model_internal::setterListenerPo_amend_id));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "enq_amend_po_serialnumber", model_internal::setterListenerEnq_amend_po_serialnumber));

    }

    /**
     * data property getters
     */

    [Bindable(event="propertyChange")]
    public function get total_qty() : int
    {
        return _internal_total_qty;
    }

    [Bindable(event="propertyChange")]
    public function get po_closed_date() : String
    {
        return _internal_po_closed_date;
    }

    [Bindable(event="propertyChange")]
    public function get pro_tax() : ArrayCollection
    {
        return _internal_pro_tax;
    }

    [Bindable(event="propertyChange")]
    public function get cre_userid_fk() : int
    {
        return _internal_cre_userid_fk;
    }

    [Bindable(event="propertyChange")]
    public function get po_remarks() : String
    {
        return _internal_po_remarks;
    }

    [Bindable(event="propertyChange")]
    public function get po_amend_serialnumber() : int
    {
        return _internal_po_amend_serialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get unit_price() : ArrayCollection
    {
        return _internal_unit_price;
    }

    [Bindable(event="propertyChange")]
    public function get po_amend_detserialnumber() : ArrayCollection
    {
        return _internal_po_amend_detserialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get po_issue_date() : String
    {
        return _internal_po_issue_date;
    }

    [Bindable(event="propertyChange")]
    public function get pro_qty() : ArrayCollection
    {
        return _internal_pro_qty;
    }

    [Bindable(event="propertyChange")]
    public function get activestatus() : Boolean
    {
        return _internal_activestatus;
    }

    [Bindable(event="propertyChange")]
    public function get total_amt() : Number
    {
        return _internal_total_amt;
    }

    [Bindable(event="propertyChange")]
    public function get enq_serialnumber_fk() : ArrayCollection
    {
        return _internal_enq_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get po_serialnumber_fk() : int
    {
        return _internal_po_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get po_amend_serialnumber_fk() : ArrayCollection
    {
        return _internal_po_amend_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get cre_datetime() : String
    {
        return _internal_cre_datetime;
    }

    [Bindable(event="propertyChange")]
    public function get po_status() : String
    {
        return _internal_po_status;
    }

    [Bindable(event="propertyChange")]
    public function get pro_total_price() : ArrayCollection
    {
        return _internal_pro_total_price;
    }

    [Bindable(event="propertyChange")]
    public function get supplier_serialnumber_fk() : int
    {
        return _internal_supplier_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get pro_serialnumber_fk() : ArrayCollection
    {
        return _internal_pro_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get discount() : Number
    {
        return _internal_discount;
    }

    [Bindable(event="propertyChange")]
    public function get expected_datetime() : String
    {
        return _internal_expected_datetime;
    }

    [Bindable(event="propertyChange")]
    public function get pro_discount() : ArrayCollection
    {
        return _internal_pro_discount;
    }

    [Bindable(event="propertyChange")]
    public function get tax() : Number
    {
        return _internal_tax;
    }

    [Bindable(event="propertyChange")]
    public function get po_amend_id() : String
    {
        return _internal_po_amend_id;
    }

    [Bindable(event="propertyChange")]
    public function get shipment_charge() : Number
    {
        return _internal_shipment_charge;
    }

    [Bindable(event="propertyChange")]
    public function get enq_amend_po_serialnumber() : ArrayCollection
    {
        return _internal_enq_amend_po_serialnumber;
    }

    /**
     * data property setters
     */

    public function set total_qty(value:int) : void
    {
        var oldValue:int = _internal_total_qty;
        if (oldValue !== value)
        {
            _internal_total_qty = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "total_qty", oldValue, _internal_total_qty));
        }
    }

    public function set po_closed_date(value:String) : void
    {
        var oldValue:String = _internal_po_closed_date;
        if (oldValue !== value)
        {
            _internal_po_closed_date = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_closed_date", oldValue, _internal_po_closed_date));
        }
    }

    public function set pro_tax(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_pro_tax;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_pro_tax = value;
            }
            else if (value is Array)
            {
                _internal_pro_tax = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of pro_tax must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_tax", oldValue, _internal_pro_tax));
        }
    }

    public function set cre_userid_fk(value:int) : void
    {
        var oldValue:int = _internal_cre_userid_fk;
        if (oldValue !== value)
        {
            _internal_cre_userid_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_userid_fk", oldValue, _internal_cre_userid_fk));
        }
    }

    public function set po_remarks(value:String) : void
    {
        var oldValue:String = _internal_po_remarks;
        if (oldValue !== value)
        {
            _internal_po_remarks = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_remarks", oldValue, _internal_po_remarks));
        }
    }

    public function set po_amend_serialnumber(value:int) : void
    {
        var oldValue:int = _internal_po_amend_serialnumber;
        if (oldValue !== value)
        {
            _internal_po_amend_serialnumber = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_amend_serialnumber", oldValue, _internal_po_amend_serialnumber));
        }
    }

    public function set unit_price(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_unit_price;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_unit_price = value;
            }
            else if (value is Array)
            {
                _internal_unit_price = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of unit_price must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "unit_price", oldValue, _internal_unit_price));
        }
    }

    public function set po_amend_detserialnumber(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_po_amend_detserialnumber;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_po_amend_detserialnumber = value;
            }
            else if (value is Array)
            {
                _internal_po_amend_detserialnumber = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of po_amend_detserialnumber must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_amend_detserialnumber", oldValue, _internal_po_amend_detserialnumber));
        }
    }

    public function set po_issue_date(value:String) : void
    {
        var oldValue:String = _internal_po_issue_date;
        if (oldValue !== value)
        {
            _internal_po_issue_date = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_issue_date", oldValue, _internal_po_issue_date));
        }
    }

    public function set pro_qty(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_pro_qty;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_pro_qty = value;
            }
            else if (value is Array)
            {
                _internal_pro_qty = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of pro_qty must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_qty", oldValue, _internal_pro_qty));
        }
    }

    public function set activestatus(value:Boolean) : void
    {
        var oldValue:Boolean = _internal_activestatus;
        if (oldValue !== value)
        {
            _internal_activestatus = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "activestatus", oldValue, _internal_activestatus));
        }
    }

    public function set total_amt(value:Number) : void
    {
        var oldValue:Number = _internal_total_amt;
        if (isNaN(_internal_total_amt) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_total_amt = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "total_amt", oldValue, _internal_total_amt));
        }
    }

    public function set enq_serialnumber_fk(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_enq_serialnumber_fk;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_enq_serialnumber_fk = value;
            }
            else if (value is Array)
            {
                _internal_enq_serialnumber_fk = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of enq_serialnumber_fk must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "enq_serialnumber_fk", oldValue, _internal_enq_serialnumber_fk));
        }
    }

    public function set po_serialnumber_fk(value:int) : void
    {
        var oldValue:int = _internal_po_serialnumber_fk;
        if (oldValue !== value)
        {
            _internal_po_serialnumber_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_serialnumber_fk", oldValue, _internal_po_serialnumber_fk));
        }
    }

    public function set po_amend_serialnumber_fk(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_po_amend_serialnumber_fk;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_po_amend_serialnumber_fk = value;
            }
            else if (value is Array)
            {
                _internal_po_amend_serialnumber_fk = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of po_amend_serialnumber_fk must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_amend_serialnumber_fk", oldValue, _internal_po_amend_serialnumber_fk));
        }
    }

    public function set cre_datetime(value:String) : void
    {
        var oldValue:String = _internal_cre_datetime;
        if (oldValue !== value)
        {
            _internal_cre_datetime = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "cre_datetime", oldValue, _internal_cre_datetime));
        }
    }

    public function set po_status(value:String) : void
    {
        var oldValue:String = _internal_po_status;
        if (oldValue !== value)
        {
            _internal_po_status = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_status", oldValue, _internal_po_status));
        }
    }

    public function set pro_total_price(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_pro_total_price;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_pro_total_price = value;
            }
            else if (value is Array)
            {
                _internal_pro_total_price = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of pro_total_price must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_total_price", oldValue, _internal_pro_total_price));
        }
    }

    public function set supplier_serialnumber_fk(value:int) : void
    {
        var oldValue:int = _internal_supplier_serialnumber_fk;
        if (oldValue !== value)
        {
            _internal_supplier_serialnumber_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "supplier_serialnumber_fk", oldValue, _internal_supplier_serialnumber_fk));
        }
    }

    public function set pro_serialnumber_fk(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_pro_serialnumber_fk;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_pro_serialnumber_fk = value;
            }
            else if (value is Array)
            {
                _internal_pro_serialnumber_fk = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of pro_serialnumber_fk must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_serialnumber_fk", oldValue, _internal_pro_serialnumber_fk));
        }
    }

    public function set discount(value:Number) : void
    {
        var oldValue:Number = _internal_discount;
        if (isNaN(_internal_discount) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_discount = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "discount", oldValue, _internal_discount));
        }
    }

    public function set expected_datetime(value:String) : void
    {
        var oldValue:String = _internal_expected_datetime;
        if (oldValue !== value)
        {
            _internal_expected_datetime = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "expected_datetime", oldValue, _internal_expected_datetime));
        }
    }

    public function set pro_discount(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_pro_discount;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_pro_discount = value;
            }
            else if (value is Array)
            {
                _internal_pro_discount = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of pro_discount must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_discount", oldValue, _internal_pro_discount));
        }
    }

    public function set tax(value:Number) : void
    {
        var oldValue:Number = _internal_tax;
        if (isNaN(_internal_tax) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_tax = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "tax", oldValue, _internal_tax));
        }
    }

    public function set po_amend_id(value:String) : void
    {
        var oldValue:String = _internal_po_amend_id;
        if (oldValue !== value)
        {
            _internal_po_amend_id = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "po_amend_id", oldValue, _internal_po_amend_id));
        }
    }

    public function set shipment_charge(value:Number) : void
    {
        var oldValue:Number = _internal_shipment_charge;
        if (isNaN(_internal_shipment_charge) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_shipment_charge = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "shipment_charge", oldValue, _internal_shipment_charge));
        }
    }

    public function set enq_amend_po_serialnumber(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_enq_amend_po_serialnumber;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_enq_amend_po_serialnumber = value;
            }
            else if (value is Array)
            {
                _internal_enq_amend_po_serialnumber = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of enq_amend_po_serialnumber must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "enq_amend_po_serialnumber", oldValue, _internal_enq_amend_po_serialnumber));
        }
    }

    /**
     * Data property setter listeners
     *
     * Each data property whose value affects other properties or the validity of the entity
     * needs to invalidate all previously calculated artifacts. These include:
     *  - any derived properties or constraints that reference the given data property.
     *  - any availability guards (variant expressions) that reference the given data property.
     *  - any style validations, message tokens or guards that reference the given data property.
     *  - the validity of the property (and the containing entity) if the given data property has a length restriction.
     *  - the validity of the property (and the containing entity) if the given data property is required.
     */

    model_internal function setterListenerPo_closed_date(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPo_closed_date();
    }

    model_internal function setterListenerPro_tax(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerPro_tax);
            }
        }
        _model.invalidateDependentOnPro_tax();
    }

    model_internal function setterListenerPo_remarks(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPo_remarks();
    }

    model_internal function setterListenerUnit_price(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerUnit_price);
            }
        }
        _model.invalidateDependentOnUnit_price();
    }

    model_internal function setterListenerPo_amend_detserialnumber(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerPo_amend_detserialnumber);
            }
        }
        _model.invalidateDependentOnPo_amend_detserialnumber();
    }

    model_internal function setterListenerPo_issue_date(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPo_issue_date();
    }

    model_internal function setterListenerPro_qty(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerPro_qty);
            }
        }
        _model.invalidateDependentOnPro_qty();
    }

    model_internal function setterListenerEnq_serialnumber_fk(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerEnq_serialnumber_fk);
            }
        }
        _model.invalidateDependentOnEnq_serialnumber_fk();
    }

    model_internal function setterListenerPo_amend_serialnumber_fk(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerPo_amend_serialnumber_fk);
            }
        }
        _model.invalidateDependentOnPo_amend_serialnumber_fk();
    }

    model_internal function setterListenerCre_datetime(value:flash.events.Event):void
    {
        _model.invalidateDependentOnCre_datetime();
    }

    model_internal function setterListenerPo_status(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPo_status();
    }

    model_internal function setterListenerPro_total_price(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerPro_total_price);
            }
        }
        _model.invalidateDependentOnPro_total_price();
    }

    model_internal function setterListenerPro_serialnumber_fk(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerPro_serialnumber_fk);
            }
        }
        _model.invalidateDependentOnPro_serialnumber_fk();
    }

    model_internal function setterListenerExpected_datetime(value:flash.events.Event):void
    {
        _model.invalidateDependentOnExpected_datetime();
    }

    model_internal function setterListenerPro_discount(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerPro_discount);
            }
        }
        _model.invalidateDependentOnPro_discount();
    }

    model_internal function setterListenerPo_amend_id(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPo_amend_id();
    }

    model_internal function setterListenerEnq_amend_po_serialnumber(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerEnq_amend_po_serialnumber);
            }
        }
        _model.invalidateDependentOnEnq_amend_po_serialnumber();
    }


    /**
     * valid related derived properties
     */
    model_internal var _isValid : Boolean;
    model_internal var _invalidConstraints:Array = new Array();
    model_internal var _validationFailureMessages:Array = new Array();

    /**
     * derived property calculators
     */

    /**
     * isValid calculator
     */
    model_internal function calculateIsValid():Boolean
    {
        var violatedConsts:Array = new Array();
        var validationFailureMessages:Array = new Array();

        var propertyValidity:Boolean = true;
        if (!_model.po_closed_dateIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_po_closed_dateValidationFailureMessages);
        }
        if (!_model.pro_taxIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_pro_taxValidationFailureMessages);
        }
        if (!_model.po_remarksIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_po_remarksValidationFailureMessages);
        }
        if (!_model.unit_priceIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_unit_priceValidationFailureMessages);
        }
        if (!_model.po_amend_detserialnumberIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_po_amend_detserialnumberValidationFailureMessages);
        }
        if (!_model.po_issue_dateIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_po_issue_dateValidationFailureMessages);
        }
        if (!_model.pro_qtyIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_pro_qtyValidationFailureMessages);
        }
        if (!_model.enq_serialnumber_fkIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_enq_serialnumber_fkValidationFailureMessages);
        }
        if (!_model.po_amend_serialnumber_fkIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_po_amend_serialnumber_fkValidationFailureMessages);
        }
        if (!_model.cre_datetimeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_cre_datetimeValidationFailureMessages);
        }
        if (!_model.po_statusIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_po_statusValidationFailureMessages);
        }
        if (!_model.pro_total_priceIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_pro_total_priceValidationFailureMessages);
        }
        if (!_model.pro_serialnumber_fkIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_pro_serialnumber_fkValidationFailureMessages);
        }
        if (!_model.expected_datetimeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_expected_datetimeValidationFailureMessages);
        }
        if (!_model.pro_discountIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_pro_discountValidationFailureMessages);
        }
        if (!_model.po_amend_idIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_po_amend_idValidationFailureMessages);
        }
        if (!_model.enq_amend_po_serialnumberIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_enq_amend_po_serialnumberValidationFailureMessages);
        }

        model_internal::_cacheInitialized_isValid = true;
        model_internal::invalidConstraints_der = violatedConsts;
        model_internal::validationFailureMessages_der = validationFailureMessages;
        return violatedConsts.length == 0 && propertyValidity;
    }

    /**
     * derived property setters
     */

    model_internal function set isValid_der(value:Boolean) : void
    {
        var oldValue:Boolean = model_internal::_isValid;
        if (oldValue !== value)
        {
            model_internal::_isValid = value;
            _model.model_internal::fireChangeEvent("isValid", oldValue, model_internal::_isValid);
        }
    }

    /**
     * derived property getters
     */

    [Transient]
    [Bindable(event="propertyChange")]
    public function get _model() : _VoAmendHeaderEntityMetadata
    {
        return model_internal::_dminternal_model;
    }

    public function set _model(value : _VoAmendHeaderEntityMetadata) : void
    {
        var oldValue : _VoAmendHeaderEntityMetadata = model_internal::_dminternal_model;
        if (oldValue !== value)
        {
            model_internal::_dminternal_model = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_model", oldValue, model_internal::_dminternal_model));
        }
    }

    /**
     * methods
     */


    /**
     *  services
     */
    private var _managingService:com.adobe.fiber.services.IFiberManagingService;

    public function set managingService(managingService:com.adobe.fiber.services.IFiberManagingService):void
    {
        _managingService = managingService;
    }

    model_internal function set invalidConstraints_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_invalidConstraints;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_invalidConstraints = value;
            _model.model_internal::fireChangeEvent("invalidConstraints", oldValue, model_internal::_invalidConstraints);
        }
    }

    model_internal function set validationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_validationFailureMessages;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_validationFailureMessages = value;
            _model.model_internal::fireChangeEvent("validationFailureMessages", oldValue, model_internal::_validationFailureMessages);
        }
    }

    model_internal var _doValidationCacheOfPo_closed_date : Array = null;
    model_internal var _doValidationLastValOfPo_closed_date : String;

    model_internal function _doValidationForPo_closed_date(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPo_closed_date != null && model_internal::_doValidationLastValOfPo_closed_date == value)
           return model_internal::_doValidationCacheOfPo_closed_date ;

        _model.model_internal::_po_closed_dateIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPo_closed_dateAvailable && _internal_po_closed_date == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "po_closed_date is required"));
        }

        model_internal::_doValidationCacheOfPo_closed_date = validationFailures;
        model_internal::_doValidationLastValOfPo_closed_date = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPro_tax : Array = null;
    model_internal var _doValidationLastValOfPro_tax : ArrayCollection;

    model_internal function _doValidationForPro_tax(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfPro_tax != null && model_internal::_doValidationLastValOfPro_tax == value)
           return model_internal::_doValidationCacheOfPro_tax ;

        _model.model_internal::_pro_taxIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPro_taxAvailable && _internal_pro_tax == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "pro_tax is required"));
        }

        model_internal::_doValidationCacheOfPro_tax = validationFailures;
        model_internal::_doValidationLastValOfPro_tax = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPo_remarks : Array = null;
    model_internal var _doValidationLastValOfPo_remarks : String;

    model_internal function _doValidationForPo_remarks(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPo_remarks != null && model_internal::_doValidationLastValOfPo_remarks == value)
           return model_internal::_doValidationCacheOfPo_remarks ;

        _model.model_internal::_po_remarksIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPo_remarksAvailable && _internal_po_remarks == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "po_remarks is required"));
        }

        model_internal::_doValidationCacheOfPo_remarks = validationFailures;
        model_internal::_doValidationLastValOfPo_remarks = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfUnit_price : Array = null;
    model_internal var _doValidationLastValOfUnit_price : ArrayCollection;

    model_internal function _doValidationForUnit_price(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfUnit_price != null && model_internal::_doValidationLastValOfUnit_price == value)
           return model_internal::_doValidationCacheOfUnit_price ;

        _model.model_internal::_unit_priceIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isUnit_priceAvailable && _internal_unit_price == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "unit_price is required"));
        }

        model_internal::_doValidationCacheOfUnit_price = validationFailures;
        model_internal::_doValidationLastValOfUnit_price = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPo_amend_detserialnumber : Array = null;
    model_internal var _doValidationLastValOfPo_amend_detserialnumber : ArrayCollection;

    model_internal function _doValidationForPo_amend_detserialnumber(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfPo_amend_detserialnumber != null && model_internal::_doValidationLastValOfPo_amend_detserialnumber == value)
           return model_internal::_doValidationCacheOfPo_amend_detserialnumber ;

        _model.model_internal::_po_amend_detserialnumberIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPo_amend_detserialnumberAvailable && _internal_po_amend_detserialnumber == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "po_amend_detserialnumber is required"));
        }

        model_internal::_doValidationCacheOfPo_amend_detserialnumber = validationFailures;
        model_internal::_doValidationLastValOfPo_amend_detserialnumber = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPo_issue_date : Array = null;
    model_internal var _doValidationLastValOfPo_issue_date : String;

    model_internal function _doValidationForPo_issue_date(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPo_issue_date != null && model_internal::_doValidationLastValOfPo_issue_date == value)
           return model_internal::_doValidationCacheOfPo_issue_date ;

        _model.model_internal::_po_issue_dateIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPo_issue_dateAvailable && _internal_po_issue_date == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "po_issue_date is required"));
        }

        model_internal::_doValidationCacheOfPo_issue_date = validationFailures;
        model_internal::_doValidationLastValOfPo_issue_date = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPro_qty : Array = null;
    model_internal var _doValidationLastValOfPro_qty : ArrayCollection;

    model_internal function _doValidationForPro_qty(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfPro_qty != null && model_internal::_doValidationLastValOfPro_qty == value)
           return model_internal::_doValidationCacheOfPro_qty ;

        _model.model_internal::_pro_qtyIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPro_qtyAvailable && _internal_pro_qty == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "pro_qty is required"));
        }

        model_internal::_doValidationCacheOfPro_qty = validationFailures;
        model_internal::_doValidationLastValOfPro_qty = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfEnq_serialnumber_fk : Array = null;
    model_internal var _doValidationLastValOfEnq_serialnumber_fk : ArrayCollection;

    model_internal function _doValidationForEnq_serialnumber_fk(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfEnq_serialnumber_fk != null && model_internal::_doValidationLastValOfEnq_serialnumber_fk == value)
           return model_internal::_doValidationCacheOfEnq_serialnumber_fk ;

        _model.model_internal::_enq_serialnumber_fkIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isEnq_serialnumber_fkAvailable && _internal_enq_serialnumber_fk == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "enq_serialnumber_fk is required"));
        }

        model_internal::_doValidationCacheOfEnq_serialnumber_fk = validationFailures;
        model_internal::_doValidationLastValOfEnq_serialnumber_fk = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPo_amend_serialnumber_fk : Array = null;
    model_internal var _doValidationLastValOfPo_amend_serialnumber_fk : ArrayCollection;

    model_internal function _doValidationForPo_amend_serialnumber_fk(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfPo_amend_serialnumber_fk != null && model_internal::_doValidationLastValOfPo_amend_serialnumber_fk == value)
           return model_internal::_doValidationCacheOfPo_amend_serialnumber_fk ;

        _model.model_internal::_po_amend_serialnumber_fkIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPo_amend_serialnumber_fkAvailable && _internal_po_amend_serialnumber_fk == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "po_amend_serialnumber_fk is required"));
        }

        model_internal::_doValidationCacheOfPo_amend_serialnumber_fk = validationFailures;
        model_internal::_doValidationLastValOfPo_amend_serialnumber_fk = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfCre_datetime : Array = null;
    model_internal var _doValidationLastValOfCre_datetime : String;

    model_internal function _doValidationForCre_datetime(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfCre_datetime != null && model_internal::_doValidationLastValOfCre_datetime == value)
           return model_internal::_doValidationCacheOfCre_datetime ;

        _model.model_internal::_cre_datetimeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isCre_datetimeAvailable && _internal_cre_datetime == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "cre_datetime is required"));
        }

        model_internal::_doValidationCacheOfCre_datetime = validationFailures;
        model_internal::_doValidationLastValOfCre_datetime = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPo_status : Array = null;
    model_internal var _doValidationLastValOfPo_status : String;

    model_internal function _doValidationForPo_status(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPo_status != null && model_internal::_doValidationLastValOfPo_status == value)
           return model_internal::_doValidationCacheOfPo_status ;

        _model.model_internal::_po_statusIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPo_statusAvailable && _internal_po_status == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "po_status is required"));
        }

        model_internal::_doValidationCacheOfPo_status = validationFailures;
        model_internal::_doValidationLastValOfPo_status = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPro_total_price : Array = null;
    model_internal var _doValidationLastValOfPro_total_price : ArrayCollection;

    model_internal function _doValidationForPro_total_price(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfPro_total_price != null && model_internal::_doValidationLastValOfPro_total_price == value)
           return model_internal::_doValidationCacheOfPro_total_price ;

        _model.model_internal::_pro_total_priceIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPro_total_priceAvailable && _internal_pro_total_price == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "pro_total_price is required"));
        }

        model_internal::_doValidationCacheOfPro_total_price = validationFailures;
        model_internal::_doValidationLastValOfPro_total_price = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPro_serialnumber_fk : Array = null;
    model_internal var _doValidationLastValOfPro_serialnumber_fk : ArrayCollection;

    model_internal function _doValidationForPro_serialnumber_fk(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfPro_serialnumber_fk != null && model_internal::_doValidationLastValOfPro_serialnumber_fk == value)
           return model_internal::_doValidationCacheOfPro_serialnumber_fk ;

        _model.model_internal::_pro_serialnumber_fkIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPro_serialnumber_fkAvailable && _internal_pro_serialnumber_fk == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "pro_serialnumber_fk is required"));
        }

        model_internal::_doValidationCacheOfPro_serialnumber_fk = validationFailures;
        model_internal::_doValidationLastValOfPro_serialnumber_fk = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfExpected_datetime : Array = null;
    model_internal var _doValidationLastValOfExpected_datetime : String;

    model_internal function _doValidationForExpected_datetime(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfExpected_datetime != null && model_internal::_doValidationLastValOfExpected_datetime == value)
           return model_internal::_doValidationCacheOfExpected_datetime ;

        _model.model_internal::_expected_datetimeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isExpected_datetimeAvailable && _internal_expected_datetime == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "expected_datetime is required"));
        }

        model_internal::_doValidationCacheOfExpected_datetime = validationFailures;
        model_internal::_doValidationLastValOfExpected_datetime = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPro_discount : Array = null;
    model_internal var _doValidationLastValOfPro_discount : ArrayCollection;

    model_internal function _doValidationForPro_discount(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfPro_discount != null && model_internal::_doValidationLastValOfPro_discount == value)
           return model_internal::_doValidationCacheOfPro_discount ;

        _model.model_internal::_pro_discountIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPro_discountAvailable && _internal_pro_discount == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "pro_discount is required"));
        }

        model_internal::_doValidationCacheOfPro_discount = validationFailures;
        model_internal::_doValidationLastValOfPro_discount = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPo_amend_id : Array = null;
    model_internal var _doValidationLastValOfPo_amend_id : String;

    model_internal function _doValidationForPo_amend_id(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPo_amend_id != null && model_internal::_doValidationLastValOfPo_amend_id == value)
           return model_internal::_doValidationCacheOfPo_amend_id ;

        _model.model_internal::_po_amend_idIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPo_amend_idAvailable && _internal_po_amend_id == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "po_amend_id is required"));
        }

        model_internal::_doValidationCacheOfPo_amend_id = validationFailures;
        model_internal::_doValidationLastValOfPo_amend_id = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfEnq_amend_po_serialnumber : Array = null;
    model_internal var _doValidationLastValOfEnq_amend_po_serialnumber : ArrayCollection;

    model_internal function _doValidationForEnq_amend_po_serialnumber(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfEnq_amend_po_serialnumber != null && model_internal::_doValidationLastValOfEnq_amend_po_serialnumber == value)
           return model_internal::_doValidationCacheOfEnq_amend_po_serialnumber ;

        _model.model_internal::_enq_amend_po_serialnumberIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isEnq_amend_po_serialnumberAvailable && _internal_enq_amend_po_serialnumber == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "enq_amend_po_serialnumber is required"));
        }

        model_internal::_doValidationCacheOfEnq_amend_po_serialnumber = validationFailures;
        model_internal::_doValidationLastValOfEnq_amend_po_serialnumber = value;

        return validationFailures;
    }
    

}

}
